app.js
App({
	onLaunch(options) {
		my.clearStorageSync();
		let paySuccess = my.getStorageSync({
			key: 'paySuccess', // 缓存数据的key
		});
		if (options.query) {
			let deviceCode = options.query.deviceCode;
			console.log(deviceCode)
			my.setStorageSync({
				key: 'deviceCode', // 缓存数据的key
				data: deviceCode, // 要缓存的数据
			});
		}
	},
	/* 退出小程序触发事件*/
	onHide(e) {
		/*支付的时候不能清除缓存 */
		let paySuccess = my.getStorageSync({
			key: 'paySuccess', // 缓存数据的key
		});
		if (!paySuccess.data) {
			console.log('在支付')
			let onlounch = false;
			my.setStorageSync({
				key: 'onlounch',
				data: onlounch
			});
			my.removeStorageSync({
				key: 'isShow'
			});
			my.removeStorageSync({
				key: 'deviceCode'
			});
			my.removeStorageSync({
				key: 'indexData'
			});
			my.clearStorageSync();
			console.log("小程序出来了清空缓存");
		};
	},
	onUnload() {
		console.log('小程序出来了');
		/*支付的时候不能清除缓存 */
		let paySuccess = my.getStorageSync({
			key: 'paySuccess', // 缓存数据的key
		});
		if (!paySuccess.data) {
			console.log('在支付')
			my.setStorageSync({
				key: 'onlounch',
				data: onlounch
			});
			my.removeStorageSync({
				key: 'isShow'
			});
			my.removeStorageSync({
				key: 'deviceCode'
			});
			my.removeStorageSync({
				key: 'indexData'
			});
			my.clearStorageSync();
		};
	},
	globalData: {
		userInfo: null,
		/*baseimg:'http://192.168.2.89:8080/path/image/logo.jpg',
		baseurl:'http://192.168.43.69:8080',//* 线下邱 */
		/* baseimg:'http://192.168.2.61:8080/path/image/logo/logo.png',
		baseurl:'http://127.0.0.1:7777',//* 线下吴 */
		/*baseimg:'http://192.168.2.89:8080/path/image/logo/logo.png',
		baseurl:'http://192.168.2.89:8080',//* 线下 */
		baseimg: 'https://oyo8.oyospider.com/image/url/common',
		baseurl: 'https://oyo8.oyospider.com', //* 线上
		/*baseimg:'http://120.78.139.135:8088/path/image/logo/logo.png', 
	    baseurl: 'http://120.78.139.135:8088', //* 线上 */
		/* baseimgurl: 'http://www.510513.site' */
		sharepage: {
			title: 'OYO',
			path: 'pages/index/index',
			success(res) {
				// 转发成功

			},
			fail(res) {
				// 转发失败

			}
		}


	}

})

/* 
 ,
 "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#000",
     "navigationBarTitleText": "御座+",
     "navigationBarTextStyle": "white"
 },
 "tabBar": {
     "selectedColor": "#ff6700",
     "borderStyle": "white",
     "backgroundColor": "#fff",
     "list": [
         {
             "text": "首页",
             "pagePath": "pages/index/index",
             "iconPath": "assets/icons/home.png",
             "selectedIconPath": "assets/icons/home_active.png"
         },
         {
             "text": "积分商城",
             "pagePath": "pages/shopcenter/shopcenter",
             "iconPath": "assets/icons/category.png",
             "selectedIconPath": "assets/icons/category_active.png"
         },
         {
             "text": "签到",
             "pagePath": "pages/discovery/discovery",
             "iconPath": "assets/icons/discovery.png",
             "selectedIconPath": "assets/icons/discovery_active.png"
         },
         {
             "text": "购物车",
             "pagePath": "pages/cart/cart",
             "iconPath": "assets/icons/cart.png",
             "selectedIconPath": "assets/icons/cart_active.png"
         },
         {
             "text": "我的",
             "pagePath": "pages/mine/mine",
             "iconPath": "assets/icons/mine.png",
             "selectedIconPath": "assets/icons/mine_active.png"
         }
     ]
 }*/
